package com.cibfintech.rpa.jdwzcx.common.dto;

import java.util.Base64;

import org.apache.commons.lang3.StringUtils;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class SearchResult {

    private boolean warn = true;

    private String base64Png;

    public byte[] screenshotBytes() {
        byte[] bytes = Base64.getMimeDecoder().decode(base64Png);
        return bytes;
    }

    public String message() {
        String m = "正常";
        if (warn)
            m = "异常";
        if (StringUtils.isBlank(base64Png))
            m = "查询错误";
        return m;
    }

}
